<template>
  <div class="yingmoo-store">
    <ul class="nav">
      <router-link tag="li" to="/ymMemberaccount">账户信息</router-link>
      <router-link tag="li" to="/ymMemberaccountamendtel">修改手机号</router-link>
      <router-link tag="li" to="/ymMemberaccountamendneweimal">修改邮箱</router-link>
      <router-link tag="li" to="/ymMemberaccountamendpassword">修改密码</router-link>
      <router-link tag="li" v-if="user.shop == 0" to="/ymMemberapplyforverify">申请验证</router-link>
    </ul>
    <div class="error">
      <el-steps :space="200" :active="3" finish-status="success">
        <el-step title="身份验证"></el-step>
        <el-step title="修改邮箱"></el-step>
        <el-step title="成功"></el-step>
      </el-steps>
      <div class="succeed">
        <img src="../assets/ym-member/account/allright.png" />
        <p>恭喜您！邮箱更改成功</p>
      </div>
      <div class="return">
        <router-link tag="div" to="/" class="submit">返回首页</router-link><span id="seconds" class="return-member">{{seconds}}</span><span class="return-member">秒后进入会员中心</span>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "yingmoo-store",
    data(){
    	return{
    		user:{},
    		seconds:5
    	}
    },
    mounted(){
    	this.countDown();
    	this.getUser();
    },
    methods:{
    	getUser:function(){
    		var data = localStorage.getItem("user");
				if(data != null){
					this.user = JSON.parse(localStorage.getItem("user"));
					console.log(this.user);
				}
    	},
    	countDown:function(){
    		var time = 5;
    		var timer = setInterval(function(){
    			if(time>0){
    				time -= 1
    				document.getElementById("seconds").innerHTML = time; 
    			}else{
    				clearInterval(timer);
    				window.location.href = "../#/"
    			}
    		},1000)
    	}
    }
  }
</script>
<style scoped>
  .el-steps {
    width: 500px;
    padding-left: 100px;
    padding-top: 35px;
  }

</style>
<style scoped lang="less">
  .yingmoo-store {
    width: 100%;
    .nav {
      width: 1200px;
      height: 46px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      background-color: #f2f2f2;
      margin-top: 20px;
      li {
        list-style: none;
        width: 90px;
        height: 30px;
        margin: 0 20px;
        line-height: 30px;
        color: #666666;
        text-align: center;
        font-size: 16px;
        cursor: pointer;
        &:nth-child(3) {
          background-color: #036eb7;
          color: white;
        }
        &:hover {
          background-color: #036eb7;
          color: white;
        }
      }
    }
    .error {
      width: 1200px;
      height: 560px;
      background-color: white;
      margin: 0 auto;
      .succeed{
        margin-left: 100px;
        margin-top: 80px;
        display: flex;
        p{
          line-height: 60px;
          font-size: 23px;
          color: #036eb7;
          margin-left: 15px;
        }
      }
      .return {
        display: flex;
        margin-left: 150px;
        .submit {
          width: 103px;
          height: 30px;
          color: white;
          background-color: #f29600;
          text-align: center;
          line-height: 30px;
          border-radius: 7px;
          margin-top: 44px;
          margin-right: 20px;
          cursor: pointer;
        }
        .return-member {
          margin-top: 44px;
          line-height: 30px;
          color: #666666;
          font-size: 14px;
        }
      }
    }
  }

</style>
